#!/bin/bash

# Note that the 'vox-urbis-cargo-registry' persistent volume should be created for the build to work
# docker volume create vox-urbis-cargo-registry

RUST_VERSION=1.75.0
IMAGE=rust:${RUST_VERSION}-slim-bullseye
CARGO_REGISTRY_VOLUME=vox-urbis-cargo-registry

docker run --rm -v `pwd`:/app -v $CARGO_REGISTRY_VOLUME:/usr/local/cargo/registry -w /app $IMAGE \
    cargo build --locked --release